home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 26.zip / BS1 part 26 / Aztec C v5.2a disk 4.adf / 204inc_h.lzh / devices / parallel.h < prev    next >
C/C++ Source or Header  |  1991-03-14  |  4KB  |  105 lines

  1. #ifndef DEVICES_PARALLEL_H
  2. #define DEVICES_PARALLEL_H
  3. /*
  4. **    $Filename: devices/parallel.h $
  5. **    $Release: 2.04 $
  6. **    $Revision: 36.1 $
  7. **    $Date: 90/05/10 $
  8. **
  9. **    parallel.device I/O request structure information
  10. **
  11. **    (C) Copyright 1985,1988,1989,1990 Commodore Amiga Inc.
  12. **        All rights reserved.
  13. */
  14.  
  15. #ifndef   EXEC_IO_H
  16. #include "exec/io.h"
  17. #endif     /* !EXEC_IO_H */
  18.  
  19.  struct  IOPArray {
  20.     ULONG PTermArray0;
  21.     ULONG PTermArray1;
  22. };
  23.  
  24. /******************************************************************/
  25. /* CAUTION !!  IF YOU ACCESS the parallel.device, you MUST (!!!!) use
  26.    an IOExtPar-sized structure or you may overlay innocent memory !! */
  27. /******************************************************************/
  28.  
  29.  struct   IOExtPar {
  30.     struct     IOStdReq IOPar;
  31.  
  32. /*     STRUCT    MsgNode
  33. *   0    APTR     Succ
  34. *   4    APTR     Pred
  35. *   8    UBYTE     Type
  36. *   9    UBYTE     Pri
  37. *   A    APTR     Name
  38. *   E    APTR     ReplyPort
  39. *  12    UWORD     MNLength
  40. *     STRUCT   IOExt
  41. *  14    APTR     io_Device
  42. *  18    APTR     io_Unit
  43. *  1C    UWORD     io_Command
  44. *  1E    UBYTE     io_Flags
  45. *  1F    UBYTE     io_Error
  46. *     STRUCT   IOStdExt
  47. *  20    ULONG     io_Actual
  48. *  24    ULONG     io_Length
  49. *  28    APTR     io_Data
  50. *  2C    ULONG     io_Offset
  51. *  30 */
  52.     ULONG    io_PExtFlags;     /* (not used) flag extension area */
  53.     UBYTE    io_Status;     /* status of parallel port and registers */
  54.     UBYTE    io_ParFlags;     /* see PARFLAGS bit definitions below */
  55.     struct    IOPArray io_PTermArray; /* termination character array */
  56. };
  57.  
  58. #define    PARB_SHARED    5       /* ParFlags non-exclusive access bit */
  59. #define    PARF_SHARED    (1<<5)       /*     "     non-exclusive access mask */
  60. #define PARB_SLOWMODE    4       /*     "     slow printer bit */
  61. #define PARF_SLOWMODE    (1<<4)       /*     "     slow printer mask */
  62. #define PARB_FASTMODE    3       /*     "     fast I/O mode selected bit */
  63. #define PARF_FASTMODE    (1<<3)       /*     "     fast I/O mode selected mask */
  64. #define PARB_RAD_BOOGIE    3       /*     "     for backward compatibility */
  65. #define PARF_RAD_BOOGIE    (1<<3)       /*     "     for backward compatibility */
  66.  
  67. #define PARB_ACKMODE    2       /*     "     ACK interrupt handshake bit */
  68. #define PARF_ACKMODE    (1<<2)       /*     "     ACK interrupt handshake mask */
  69.  
  70. #define PARB_EOFMODE    1       /*     "     EOF mode enabled bit */
  71. #define PARF_EOFMODE    (1<<1)       /*     "     EOF mode enabled mask */
  72.  
  73. #define IOPARB_QUEUED    6       /* IO_FLAGS rqst-queued bit */
  74. #define IOPARF_QUEUED    (1<<6)       /*     "     rqst-queued mask */
  75. #define    IOPARB_ABORT    5       /*     "     rqst-aborted bit */
  76. #define    IOPARF_ABORT    (1<<5)       /*     "     rqst-aborted mask */
  77. #define    IOPARB_ACTIVE    4       /*     "     rqst-qued-or-current bit */
  78. #define    IOPARF_ACTIVE    (1<<4)       /*     "     rqst-qued-or-current mask */
  79. #define    IOPTB_RWDIR    3       /* IO_STATUS read=0,write=1 bit */
  80. #define    IOPTF_RWDIR    (1<<3)       /*     "     read=0,write=1 mask */
  81. #define    IOPTB_PARSEL    2       /*     "     printer selected on the A1000 */
  82. #define    IOPTF_PARSEL    (1<<2)       /* printer selected & serial "Ring Indicator"
  83.                       on the A500 & A2000.  Be careful when
  84.                       making cables */
  85. #define    IOPTB_PAPEROUT 1       /*     "     paper out bit */
  86. #define    IOPTF_PAPEROUT (1<<1)       /*     "     paper out mask */
  87. #define    IOPTB_PARBUSY  0       /*     "     printer in busy toggle bit */
  88. #define    IOPTF_PARBUSY  (1<<0)       /*     "     printer in busy toggle mask */
  89. /* Note: previous versions of this include files had bits 0 and 2 swapped */
  90.  
  91. #define PARALLELNAME        "parallel.device"
  92.  
  93. #define PDCMD_QUERY        (CMD_NONSTD)
  94. #define PDCMD_SETPARAMS    (CMD_NONSTD+1)
  95.  
  96. #define ParErr_DevBusy            1
  97. #define ParErr_BufTooBig    2
  98. #define ParErr_InvParam    3
  99. #define ParErr_LineErr        4
  100. #define ParErr_NotOpen        5
  101. #define ParErr_PortReset    6
  102. #define ParErr_InitErr            7
  103.  
  104. #endif    /* DEVICES_PARALLEL_H */
  105.